Skip to content

Marked application/config/config.php as a configuration file in packages #1594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

craigcomstock
Copy link
Contributor

@craigcomstock craigcomstock commented Feb 20, 2025

related to management of share/GUI and not-share/GUI of two php configuration files: cfengine/masterfiles#2988

Ticket: ENT-12658
Changelog: none

@cf-bottom
Copy link

Thanks for submitting a pull request! Maybe @craigcomstock can review this?

Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully object to the glob in the spec file, but I do lean a bit towards full enumeration

… packages

To change the port, masterfiles can change these files which are distributed as part of the package so we must mark them as configuration files.
cfengine/masterfiles#2987

Ticket: ENT-12658
Changelog: none
Copy link
Member

@nickanderson nickanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think we should mark the files in share/GUI as config files? They aren't the actual files that are used by the application.

Those files should only be modified if we have defined mpf_enable_mission_portal_docroot_sync_from_share_gui.

bundle agent update_cli_rest_server_url_config
{
  vars:
    # Both share and live versions must be changed at once since httpd will be restarted later in the same agent run.
    "mp_config_file" string => "$(cfe_internal_hub_vars.docroot)/application/config/config.php";
    "mp_share_config_file" string => "$(sys.workdir)/share/GUI/application/config/config.php";
    "regex_test_pattern" string => ".*localhost:$(cfe_internal_hub_vars.https_port).*";

  files:
    mpf_enable_mission_portal_docroot_sync_from_share_gui::
      "$(mp_share_config_file)"
        handle => "cfe_internal_edit_share_gui_mp_config",
        edit_line => change_cli_rest_server_url_port,
        if => and(
                   fileexists("$(mp_share_config_file)"),
                   islessthan(countlinesmatching("$(regex_test_pattern)", "$(mp_share_config_file)"), 1)
        );

    any::
      "$(mp_config_file)"
        handle => "cfe_internal_edit_mp_config",
        edit_line => change_cli_rest_server_url_port,
        if => and(
          fileexists("$(mp_config_file)"),
          islessthan(countlinesmatching("$(regex_test_pattern)", "$(mp_config_file)"), 1)
          );
}

I was thinking that we should not mark any of the files in share/GUI as config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants